<template>
  <el-carousel height="350px" class="carousel">
    <el-carousel-item v-for="course in courses" :key="course.id">
      <router-link v-bind:to="'/detail?id=' + course.id">
        <el-image class="carousel-image" :src="course.image" fit="fill"></el-image>
      </router-link>
    </el-carousel-item>
  </el-carousel>
</template>

<script>
  export default {
    name: "the-carousel",
    props: {
      courses: {}
    }
  }
</script>

<style lang="less">
  .carousel {
    background-color: #d3dce6;
    height: 100%;

    .carousel-image {
      width: 100%;
      height: 350px;
    }
  }
</style>